import './styles/index.less';

import VSideMenuComps from './components/v-side-menu';
import VButtonComps from './components/v-button';
import VCheckboxComps from './components/v-checkbox';
import VRadioComps from './components/v-radio';
import VGridComps from './components/v-grid';
import VSpinnerComps from './components/v-spinner';
import VProgressBarComps from './components/v-progress-bar';
import VAlertComps from './components/v-alert';
import VToggleComps from './components/v-toggle';
import VInputComps from './components/v-input';
import VFormComps from './components/v-form';
import VTabComps from './components/v-tabs';
import VToastComps from './components/v-toast';
import { VModal } from './components/v-modal';
import VBreadcrumbComps from './components/v-breadcrumb';
import VTagComps from './components/v-tag';
import VSelectComps from './components/v-select';
import VPaginationComps from './components/v-pagination';
import VDialogComps from './components/v-dialog';
import VTreeComps from './components/v-tree';
import VLoadingComps from './components/v-loading';
import VStepsComps from './components/v-steps';
import VTooltipComps from './components/v-tooltip';
import VTableComps from './components/v-table';
import VAvatarComps from './components/v-avatar';
import VDropdownComps from './components/v-dropdown';
import VDatepickerComps from './components/v-datepicker';
import VCountComps from './components/v-count';
import VAutocompleteComps from './components/v-autocomplete';
import VPhotoBrowserComps from './components/v-photo-browser';
import VNotificationComps from './components/v-notification';
import VUploadComps from './components/v-upload';

const TIMER = null;

const { VSideMenu, VSideMenuItemGroup, VSideMenuItem, VSideSubMenu } = VSideMenuComps;
const { VButton, VButtonsGroup } = VButtonComps;
const { VCheckbox, VCheckboxGroup } = VCheckboxComps;
const { VRadio, VRadioGroup, VRadioButton } = VRadioComps;
const { VCol, VRow } = VGridComps;
const { VSpinner } = VSpinnerComps;
const { VProgressBar, $VProgressBar } = VProgressBarComps;
const { VAlert } = VAlertComps;
const { VToggle } = VToggleComps;
const { VInput } = VInputComps;
const { VForm, VFormItem } = VFormComps;
const { VTabs, VTabPane } = VTabComps;
const { VToast } = VToastComps;
const { VBreadcrumb, VBreadcrumbItem } = VBreadcrumbComps;
const { VTag } = VTagComps;
const { VSelect, VSelectDropdown, VOption, VOptionGroup } = VSelectComps;
const { VPagination } = VPaginationComps;
const { VDialog } = VDialogComps;
const { VTree } = VTreeComps;
const { VLoading } = VLoadingComps;
const { VStep, VSteps } = VStepsComps;
const { VTooltip } = VTooltipComps;
const { VTable, VTableColumn } = VTableComps;
const { VAvatar } = VAvatarComps;
const { VDropdown, VDropdownMenu, VDropdownItem } = VDropdownComps;
const { DatePicker, TimePicker, TimeSelect } = VDatepickerComps;
const { VCount } = VCountComps;
const { VAutocomplete } = VAutocompleteComps;
const { VPhotoBrowser } = VPhotoBrowserComps;
const { VNotification } = VNotificationComps;
const { VUpload } = VUploadComps;

export default {
  install(Vue) {
    // Side Menu
    Vue.component(VSideMenu.name, VSideMenu);
    Vue.component(VSideMenuItemGroup.name, VSideMenuItemGroup);
    Vue.component(VSideMenuItem.name, VSideMenuItem);
    Vue.component(VSideSubMenu.name, VSideSubMenu);
    // Button
    Vue.component(VButton.name, VButton);
    Vue.component(VButtonsGroup.name, VButtonsGroup);
    // Form
    Vue.component(VCheckbox.name, VCheckbox);
    Vue.component(VCheckboxGroup.name, VCheckboxGroup);
    Vue.component(VRadio.name, VRadio);
    Vue.component(VRadioGroup.name, VRadioGroup);
    Vue.component(VRadioButton.name, VRadioButton);
    // Grid
    Vue.component(VCol.name, VCol);
    Vue.component(VRow.name, VRow);
    // Spinner
    Vue.component(VSpinner.name, VSpinner);
    // Alert
    Vue.component(VAlert.name, VAlert);
    // Toggle
    Vue.component(VToggle.name, VToggle);
    // Breadcrumb
    Vue.component(VBreadcrumb.name, VBreadcrumb);
    Vue.component(VBreadcrumbItem.name, VBreadcrumbItem);
    // Tag
    Vue.component(VTag.name, VTag);

    // Progress bar
    Vue.component(VProgressBar.name, VProgressBar);

    // Form
    Vue.component(VInput.name, VInput);
    Vue.component(VForm.name, VForm);
    Vue.component(VFormItem.name, VFormItem);

    // Tab
    Vue.component(VTabs.name, VTabs);
    Vue.component(VTabPane.name, VTabPane);

    // Select
    Vue.component(VSelect.name, VSelect);
    Vue.component(VSelectDropdown.name, VSelectDropdown);
    Vue.component(VOption.name, VOption);
    Vue.component(VOptionGroup.name, VOptionGroup);

    // Pagination
    Vue.component(VPagination.name, VPagination);

    // Dialog
    Vue.component(VDialog.name, VDialog);

    // Tree
    Vue.component(VTree.name, VTree);

    // Steps
    Vue.component(VStep.name, VStep);
    Vue.component(VSteps.name, VSteps);

    // Tooltip
    Vue.component(VTooltip.name, VTooltip);

    // Table
    Vue.component(VTableColumn.name, VTableColumn);
    Vue.component(VTable.name, VTable);

    // Avatar
    Vue.component(VAvatar.name, VAvatar);

    // Dropdown
    Vue.component(VDropdown.name, VDropdown);
    Vue.component(VDropdownItem.name, VDropdownItem);
    Vue.component(VDropdownMenu.name, VDropdownMenu);

    // Datepicker
    Vue.component(DatePicker.name, DatePicker);
    Vue.component(TimePicker.name, TimePicker);
    Vue.component(TimeSelect.name, TimeSelect);

    // Count
    Vue.component(VCount.name, VCount);

    // Autocomplete
    Vue.component(VAutocomplete.name, VAutocomplete);

    //upload
    Vue.component(VUpload.name, VUpload);

    /* eslint no-param-reassign: 0 */
    Vue.prototype.$timer = TIMER;
    Vue.prototype.$progress = $VProgressBar;
    Vue.prototype.$toast = VToast;

    Vue.prototype.$alert = VModal.alert;
    Vue.prototype.$confirm = VModal.confirm;
    Vue.prototype.$prompt = VModal.prompt;
    Vue.prototype.$modal = VModal;

    Vue.prototype.$loading = VLoading;
    Vue.prototype.$photoBrowser = VPhotoBrowser.open;
    Vue.prototype.$notify = VNotification;
  },
};
